# -*- coding:utf-8 -*-

from .cache import CartCache

def goods_num(request):
	goods_num = 0
	if request.user.is_authenticated():
		carCache = CartCache(request.user)
		datas = carCache.get_all()
		goods_num = len(datas.keys())
	return {"goods_num": goods_num}